class CreateLogLoginHistories < ActiveRecord::Migration[5.1]
  def change
    create_table :log_login_histories do |t|
      t.integer :user_id, comment: '关联用户'
      t.string :username, comment: '登录名'
      t.string :password, comment: '密码'
      t.integer :status, comment: '登录状态'
      t.integer :customer_id, comment: '对应客户'
      t.string :platform, comment: '登录平台'
      t.string :ip, comment: '登录ip'

      t.timestamps
    end

    add_index :log_login_histories, :user_id
    add_index :log_login_histories, :username
    add_index :log_login_histories, :customer_id
    add_index :log_login_histories, :ip
  end
end
